package Thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo27 {

    public static void main(String[] args) {
        // service就是抽象出来的线程池对象，现在里面有4个固定的线程
        ExecutorService service =  Executors.newFixedThreadPool(4);

        // submit方法就是给线程添加任务
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("Runnable");
            }
        });

    }

}
